home *** CD-ROM | disk | FTP | other *** search
/ Scene Storm / Scene Storm - Volume 1.iso / coding / c / changedir / ccd.h < prev    next >
C/C++ Source or Header  |  1995-11-05  |  3KB  |  95 lines

  1. /*
  2.  * ccd.h
  3.  */
  4.  
  5. /* $Id: ccd.h,v 1.8 1993/07/03 12:44:41 beust Exp $ */
  6.  
  7. #ifndef __CCD_H__
  8. #define __CCD_H__
  9.  
  10. #include "database.h"
  11.  
  12. #define CCD_VAR_LAST_DIR "ccd/LAST_DIR"
  13. #define CCD_FILE_DEFAULT_CONFIG "ccd:.ccdconfig"
  14. #define CCD_FILE_DEFAULT_ANTI_CONFIG "ccd:.ccdanticonfig"
  15. #define CCD_FILE_REXX "t:ccdChangeDir.rexx"
  16. #define CCD_FILE_GUIDE "t:ccd.guide"
  17.  
  18. /* How each line of the config file is represented */
  19. typedef struct _Entry {
  20.   char *fullPath;      /* full pathname of the entry */
  21.   char *name;         /* name that will appear in the GUI */
  22.   char *spaces;      /* number of spaces to put before */
  23.   int line;
  24. } *Entry;
  25.  
  26. /* The options given on the command line */
  27. struct Prefs {
  28.   LONG create;            /* BOOL actually */
  29.   LONG update;            /* BOOL actually */
  30.   char *configFile;
  31.   char *antiConfigFile;
  32.   LONG noExpand;          /* BOOL actually, but must be long-aligned */
  33.   LONG showAmbiguities;   /* BOOL actually */
  34.   LONG gui;               /* BOOL actually */
  35.   LONG verbose;           /* BOOL actually */
  36.   char **dirs;
  37. };
  38.  
  39. struct GlobalVars {
  40.   struct IntuitionBase *IntuitionBase;
  41.   char *usage;
  42.   struct Prefs prefs;
  43.   DataBase db;                /* will contain the descriptors (struct _Entry) */
  44.   DataBase ambdb;            /* will contain the ambiguities (struct _Entry) */
  45.   DataBase antidb;          /* will contain the anti database (struct _Entry) */
  46.   char actualdir[128];
  47.   struct Window *win;
  48.   int configLines;    /* number of lines in ccdconfig */
  49.   int actualLine;
  50.   BPTR lockList[128];
  51.   int lockpt;
  52.   int dirCount;    /* number of directories on the command line */
  53. };
  54.  
  55. /****************************************************************************/
  56. /* ccd.c */
  57. /****************************************************************************/
  58.  
  59. void
  60. displayDir(struct GlobalVars *gv, int line);
  61. /* Display the directory of the volume in the window, starting at the */
  62. /* line in the config file */
  63.  
  64. void updatePrompt(char *currentdir);
  65. /* Update the concerned field with the new current dir                 */
  66. /* This routine is for users of wshell or such, thar display this name */
  67. /* as the shell prompt.                                                */
  68. /* This trick was previously pointed to me by Henry J. Cobb on Usenet  */
  69. /* for my 'find' program (another great utility of mine :-)).          */
  70. /* Let him be thanked again!                                           */
  71.  
  72. void getRealName(struct GlobalVars *gv, BPTR lock, char *result);
  73. /* This is a very useful function! Put in result path of lock */
  74. /* Assume lock is not null */
  75. /* Result always device:dir/dir/...   */
  76.  
  77. void changeDir(struct GlobalVars *gv, char *dir, int occ);
  78. /* The main function to change to the fragment of dir given,  */
  79. /* to the occ'th occurence found in the config file */
  80. /* New 1.3: first, try to cd right into 'dir' */
  81.  
  82. void showAmbiguities(struct GlobalVars *gv, char *dir);
  83. /* Display the directory of the volume in the window */
  84.  
  85. /****************************************************************************/
  86. /* graphics.c */
  87. /****************************************************************************/
  88.  
  89. void
  90. displayTree(struct GlobalVars *gv, DataBase db);
  91. /* Graphically display the tree */
  92. /* The selected directory will be found in the variable $CCD/LAST_DIR */
  93.  
  94. #endif
  95.